--藏密
local zangmi = fk.CreateSkill {
    name = "mcdh_zangmi",
    tags = {Skill.Switch}
}

zangmi:addEffect(fk.AfterCardsMove,{
    can_trigger = function(self, event, target, player, data)
        if  player:hasSkill(zangmi.name) and player:usedSkillTimes(self.name,Player.HistoryTurn) < 2  then
            for _, move in ipairs(data) do
                if move.moveReason == fk.ReasonUse and move.from == player then
                    for _, info in ipairs(move.moveInfo) do
                        if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
                            return player:getSwitchSkillState(zangmi.name) == fk.SwitchYang
                        end
                    end
                elseif move.from == player then
                    for _, info in ipairs(move.moveInfo) do
                        if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
                            return player:getSwitchSkillState(zangmi.name) == fk.SwitchYin
                        end
                    end
                end
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        player:drawCards(1,self.name)
    end
})

Fk:loadTranslationTable {
    ["mcdh_zangmi"] = "藏密",
    [":mcdh_zangmi"] = "转换技，每回合限两次,当你：①因；②不因：使用而失去牌后，你可以摸一张牌。",
}

return zangmi